<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "comment".
 *
 * @property string $id
 * @property string $content
 * @property integer $article_id
 * @property integer $user_id
 * @property integer $recovery_id
 * @property integer $parent_id
 * @property integer $create_time
 * @property integer $update_time
 */
class Comment extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'comment';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['content', 'article_id', 'user_id', 'recovery_id', 'parent_id', 'create_time', 'update_time'], 'required'],
            [['article_id', 'user_id', 'recovery_id', 'parent_id', 'create_time', 'update_time'], 'integer'],
            [['content'], 'string', 'max' => 60],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => '主键',
            'content' => '评论内容',
            'article_id' => '文章id',
            'user_id' => '评论者id',
            'recovery_id' => '回复者id',
            'parent_id' => '父评论id',
            'create_time' => '评论时间',
            'update_time' => '修改时间',
        ];
    }
}
